package com.shujia.partition;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/*
*
   K1:行偏移量 LongWriteable  V1:行文本数据
   K2:行文本数据  Text         V2:NUllWriteable

* */
public class PartitionMapper extends Mapper<LongWritable, Text,Text, NullWritable> {
    //map方法将K1和V1转为K2和V2
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        context.write(value,NullWritable.get());
    }
}
